package com.kgc.xsProvider.dao;

import com.kgc.basic.util.ResponseMsg;
import com.kgc.store.pojo.OutStore;
import com.kgc.xs.pojo.SalesInvoice;
import com.kgc.xs.pojo.SalesInvoiceDetail;
import com.kgc.xs.pojo.SalesOut;
import com.kgc.xs.pojo.SalesOutDetail;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

public interface SalesInvoiceMapper {


    //回显
    SalesInvoice selectSalesInvoiceByCode(@RequestParam("code") String code);

    //明细回显
    List<SalesInvoiceDetail> selectSalesInvoiceDetailByCode(@RequestParam("invoiceCode") String invoiceCode);


    List<SalesInvoice> selectSalesInvoiceByPage(@RequestBody Map<String, Object> map);

    //根据客户（cid）查询对应销售出库单
    List<SalesOut> selectSalesOutByCid(int customerId);

    //
    List<OutStore> getOutStoreList(Map<String, Object> map);

    //根据销售出库单单据编号查询该单据的明细
    List<SalesOutDetail> selectSalesOutByCode(@RequestParam("code") String code);

    int insertSalesInvoice(SalesInvoice salesInvoice);

    int deleteSalesInvoice(@RequestParam("id") int id);


    int insertSalesInvoiceDetail(SalesInvoiceDetail detail);

    //根据单据编号删除主表数据
    int deleteSalesInvoiceByCode(String code);

    //根据关联的单据编号删除明细表数据
    int deleteSalesDetailsByCode(String code);
}
